﻿using RxxApi.Common.Helper;
using RxxApi.IServices.System;
using RxxApi.Model.Entity;
using RxxApi.Model.ViewModels;
using RxxApi.Repository.BASE;
using RxxApi.Services.BASE;
using SqlSugar;
namespace RxxApi.Services.System;

public class SysUserServices : BaseServices<SysUser>, ISysUserServices
{
    private readonly IBaseRepository<SysUserRole> _userRoleRepository;
    private readonly IBaseRepository<SysRole> _roleRepository;

    public SysUserServices(IBaseRepository<SysUserRole> userRoleRepository, IBaseRepository<SysRole> roleRepository)
    {
        _userRoleRepository = userRoleRepository;
        _roleRepository = roleRepository;
    }
    public async Task<SysUser> GetUserInfo(string loginName, string loginPwd)
    {
        return (await Query(a => a.LoginName == loginName && a.LoginPWD == loginPwd)).FirstOrDefault();
    }
}
